//
//  DPDetailModel.m
//  TimeManager
//
//  Created by 刘凯敏 on 04/12/2016.
//  Copyright © 2016 刘凯敏. All rights reserved.
//

#import "DPDetailModel.h"

@implementation DPDetailModel
/*
 将某个对象写入文件时候会调用
 在这个方法中说清楚哪些属性需要存储
 */
- (void) encodeWithCoder:(NSCoder *) encode{
    [encode encodeObject:self.name forKey:@"name"];
    [encode encodeObject:self.place forKey:@"phone"];
}
/*
 解析对象的时候会调用这个方法
 需要解析哪些属性
 */
- (id) initWithCoder:(NSCoder *) decoder{
    if(self = [super init]){
        self.name = [decoder decodeObjectForKey:@"name"];
        self.place = [decoder decodeObjectForKey:@"phone"];
    }
    return self;
}

@end
